package com.googlecode.garbagecan.commons.execstudy;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;

public class Cat {
	public static void main(String[] args) throws Exception {
		if (args.length != 1) {
			System.err.println("Please input the file path.");
			System.exit(10);
		}
		File file = new File(args[0]);
		if (!file.isFile() || !file.exists()) {
			System.err.println("The given file does not exist.");
			System.exit(10);
		}
		
		BufferedReader reader = new BufferedReader(new FileReader(file));
		String line = null;
		while ((line = reader.readLine()) != null) {
			System.out.println(line);
		}
		
		System.exit(0);
	}
}
